home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Sunday Times: The Month 2003 December
/
The Sunday Times - The Month 2003-12.iso
/
mac
/
The Month DEC 03
/
engine
/
modules
/
preview_listen_releases.swf
/
scripts
/
frame_1
/
DoAction_2.as
next >
Wrap
Text File
|
2003-11-10
|
4KB
|
108 lines
function PlayList()
{
this.arrFilePaths = new Array();
this.arrTracks = new Array();
this.arrFilePaths[0] = "blue";
this.arrTracks[0] = ["taste_it","bubblin","rock_the_night","back_it_up","when_summers_gone","walk_away"];
this.arrFilePaths[1] = "chemical";
this.arrTracks[1] = ["block_rockin_beats","hey_boy_hey_girl","leave_home","let_forever_be","the_golden_path","get_yourself_high_feat"];
this.arrFilePaths[2] = "furtado";
this.arrTracks[2] = ["fresh_off_the_boat","powerless","explode","try"];
this.arrFilePaths[3] = "jackson";
this.arrTracks[3] = ["rock_with_you","billie_jean","smooth_criminal","earth_song","blood_on_the_dance_floor","human_nature"];
this.arrFilePaths[4] = "mayer";
this.arrTracks[4] = ["clarity","new_deep","come_back_to_bed","wheel","daughters","bigger_than_my_body"];
this.arrFilePaths[5] = "minogue";
this.arrTracks[5] = ["slow","still_standing","promises","sweet_music","chocolate","i_feel_for_you"];
this.arrFilePaths[6] = "springsteen";
this.arrTracks[6] = ["hungry_heart","thunder_road","born_to_run","the_river","the_rising","streets_of_philadelphia"];
this.arrFilePaths[7] = "suede";
this.arrTracks[7] = ["beautiful_ones","animal_nitrate","wild_ones","stay_together","shes_in_fashion","saturday_night"];
this.arrFilePaths[8] = "valance";
this.arrTracks[8] = ["hypnotic","state_of_mind","desire","curious","roll_over","tongue_tied"];
this.numberOfArtists = this.arrTracks.length;
this.currArtistId = 0;
this.currTrackId = 0;
this.firstPlay = true;
this.lastTrack = null;
this.playTrack = function()
{
var trackToPlay = this.arrTracks[this.currArtistId][this.currTrackId];
var fileToLoad = Tardis.ASSETS_FOLDER + "audio/music/" + this.arrFilePaths[this.currArtistId] + "/" + trackToPlay + ".mp3";
sndObj.stop();
delete sndObj;
soundClip_mc.removeMovieClip();
createEmptyMovieClip("soundClip_mc",++depth);
sndObj = new Sound(soundClip_mc);
sndObj.onLoad = function()
{
this.start();
};
sndObj.loadSound(fileToLoad,false);
this.currSound = sndObj;
this.monitorID = setInterval(this,"monitorTrackPosition",40);
mc_images.doOver(this.currArtistId);
autoPlayingTracks = true;
var mcToLolite = this.lastTrack;
var mcToHilite = Tardis.template.mcTR["mc_txt_" + this.currArtistId];
Tardis.template.mcTR.doPlaylistTrackHilite(mcToHilite,mcToLolite);
this.lastTrack = mcToHilite;
this.firstPlay = false;
};
this.playNextTrack = function()
{
this.currTrackId = this.currTrackId + 1;
if(this.currTrackId == this.arrTracks[this.currArtistId].length)
{
this.currTrackId = 0;
this.currArtistId = this.currArtistId + 1;
while(this.arrFilePaths[this.currArtistId] == "")
{
this.currArtistId = this.currArtistId + 1;
}
if(this.currArtistId == this.numberOfArtists)
{
this.currArtistId = 0;
}
}
this.playTrack();
};
this.monitorTrackPosition = function()
{
if(this.currSound && this.currSound.duration)
{
if(this.currSound.position >= this.currSound.duration)
{
clearInterval(this.monitorID);
this.currSound.stop();
this.currSound = 0;
this.playNextTrack();
}
}
};
this.stopTrack = function()
{
clearInterval(this.monitorID);
autoPlayingTracks = false;
Tardis.template.mcTR.txtOut(Tardis.template.mcTR["mc_txt_" + this.currArtistId]);
this.clearUp();
};
this.clearUp = function()
{
clearInterval(this.monitorID);
sndObj.stop();
delete sndObj;
delete this.currSound;
};
this.playTrack();
}
function initAutoplay()
{
myPlayList = new PlayList();
}
function stopAutoplay()
{
myPlayList.stopTrack();
}
autoPlayingTracks = false;